package com.ruicar.afs.cloud.finance.controller;

import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.common.mq.finance.debit.dto.VoucherSuccessDataDto;
import com.ruicar.afs.cloud.finance.common.service.FinanceBusinessAccountingService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/businessAccounting")
@AllArgsConstructor
public class FinanceBusinessAccountingController {

    private final FinanceBusinessAccountingService financeBusinessAccountingService;

    @ApiOperation(value = "保存核算明细")
    @PostMapping("/save")
    public IResponse save(@RequestBody VoucherSuccessDataDto voucherSuccessDataDto) {
        return new IResponse().setData(financeBusinessAccountingService.save(voucherSuccessDataDto));
    }
}
